package com.jhs.kjs.handler;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

public class PezUtil {
	public static String getDateWithFormat(Date d, String f){
		if(d==null) return "";
		return new SimpleDateFormat(f, Locale.KOREAN).format(d);
	}
	public static String getDateWithFormat(String d, String f) throws ParseException{
		if(d==null) return "";
		return getDateWithFormat(new SimpleDateFormat(f, Locale.KOREAN).parse(d), f);
	}
	
	public static String getDateyyyyMMdd(Date d){
		if(d==null) return "";
		return getDateWithFormat(d, "yyyy-MM-dd");
	}
	
	public static String getDateyyyyMMddahhmmss(Date d){
		if(d==null) return "";
		return getDateWithFormat(d, "yyyy-MM-dd a hh:mm:ss");
	}
}
